#include <bits/stdc++.h>
using namespace std;

struct TreeNode {
	int val;
	TreeNode *left;
	TreeNode *right;
	TreeNode() : val(0), left(nullptr), right(nullptr) {}
	TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
	TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
};
class Test{
public:
	bool traversal(TreeNode* root,int count){
		if(!root->left && !root->right && count == 0){
			return true;
		}
		if(!root->left && !root->right){
			return false;
		}
		if(root->left){
			if(traversal(root->left,count - root->left->val)){
				return true;
			}
		}
		if(root->right){
			if(traversal(root->right,count - root->right->val)){
				return true;
			}
		}
		return false;
	}
	bool hasPathSum(TreeNode* root,int sum){
		if(root == NULL){
			return false;
		}
		return traversal(root,sum - root->val);
	}
};

int main(){
	
	return 0;
}
